{extend name="public:base"}
{block name='css'}
<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
{/block}
{block name="js"}
<!--<script src="__PUBLIC__/js/plugins/peity/jquery.peity.min.js"></script>-->
<!--<script src="__PUBLIC__/js/content.min.js"></script>-->

<script type="text/javascript">
    function del(self, id){
        if ($(self).hasClass('ed')) {
            return false;
        }

        layer.confirm('真的要删除吗？删除后将无法找回！', {
            btn: ['确定','取消'] //按钮
        }, function(){
            myRequestRefresh(self, "{:url('business_del')}", {id:id});
        }, function(){

        });
    }

    function confirmPay(self, id){
        if ($(self).hasClass('ed')) {
            return false;
        }

        layer.confirm('确定要通过用户的申请吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            myRequestRefresh(self, "{:url('r_check')}", {id:id,state:1});
        }, function(){

        });
    }

    function confirmRefuse(self, id){
        if ($(self).hasClass('ed')) {
            return false;
        }

        layer.confirm('确定要拒绝用户的申请吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            // layer.prompt({title: '请输入拒绝理由，并确认', formType: 2}, function(text, index){
            //     layer.close(index);,reason:text
                myRequestRefresh(self, "{:url('r_check')}", {id:id,state:2});
            // });
        }, function(){

        });
    }
</script>
{/block}
{block name='body'}
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">

        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>实名认证</h5>
                    </div>
                    <div class="ibox-content">
						<div class="row">
							<form name="form" action="{:url('index')}" method="get">
                                <!-- <div class="col-sm-2 m-b-xs">
                                    <select name="state" class="input-sm  form-control">
                                        <option value="">审核状态</option>
                                        <option value="1" {if condition="input('state', 0, 'intval') eq 1"} selected {/if} >审核中</option>
                                        <option value="2" {if condition="input('state', 0, 'intval') eq 2"} selected {/if} >审核通过</option>
                                        <option value="3" {if condition="input('state', 0, 'intval') eq 3"} selected {/if} >审核不通过</option>
                                        <option value="2" {if condition="input('state', 0, 'intval') eq 4"} selected {/if} >修改信息审核通过</option>
                                        <option value="3" {if condition="input('state', 0, 'intval') eq 5"} selected {/if} >修改信息审核不通过</option>
                                    </select>
                                </div> -->
                                <div class="col-sm-3 m-b-xs">
                                    <div class="input-group">
                                        <input type="text" name="keywords" value="{:input('keywords')}" placeholder="编号" class="input-sm input-sm form-control"> <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                    </div>
                                </div>
							</form>
                        </div>
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>会员编号</th>
                                    <th>真实姓名</th>
                                    <th>身份证</th>
                                    <th>身份证正面</th>
                                    <th>身份证反面</th>
                                    <th>审核时间</th>
                                    <th>审核人</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
								{volist name="list" id="li"}
                                <tr>
                                    <td>{$li.ucode}</td>
                                    <td>{$li.real_name}</td>
                                    <td>{$li.id_card}</td>
                                    <td><a href="{$li.card_up}" target="_blank"><img src="{$li.card_up}" height="50px;"/></a></a></td>
                                    <td><a href="{$li.card_down}" target="_blank"><img src="{$li.card_down}" height="50px;"/></a></a></td>
                                    <td>
                                        {if $li.state!==0}
                                          {$li.confirm_time|date='Y-m-d H:i:s',###}
                                        {else/}
                                        -
                                        {/if}
                                      </td>
                                      <td>
                                        {if $li.state!==0}
                                          {$li.admin_name}
                                        {else/}
                                        -
                                        {/if}
                                       
                                      </td>
                                    <td>
                                        {switch name="li.state"}
                                        {case value="0"}<a href="javascript:;" class="btn btn-primary btn-xs">审核中</a>{/case}
                                        {case value="1"}<a href="javascript:;" class="btn btn-info btn-xs">审核通过</a>{/case}
                                        {case value="2"}<a href="javascript:;" class="btn btn-danger btn-xs">审核不通过</a><br>{$li.reason}{/case}
                                        {case value="4"}<a href="javascript:;" class="btn btn-info btn-xs">修改信息审核中</a>{/case}
                                        {case value="5"}<a href="javascript:;" class="btn btn-danger btn-xs">修改信息审核不通过</a><br>{$li.reason}{/case}
                                        {/switch}
                                    </td>
                                    <td>
                                        {if condition="$li.state eq 0"}
										<a href="javascript:;" onclick="confirmPay(this, {$li.id})" class="btn btn-info btn-xs">通过</a>
                                        <a href="javascript:;" onclick="confirmRefuse(this, {$li.id})" class="btn btn-danget btn-xs">拒绝</a>
                                        {/if}
                                        <!-- {eq name="li.state" value="0"}
	                                    <a href="javascript:;" onclick="return del(this, {$li.id});" class="btn btn-danger btn-xs delete"><i class="fa fa-trash-o"></i> 删除</a>
                                        {/eq} -->
									</td>
                                </tr>
								{/volist}
                            </tbody>
							<tfoot>
								<tr>
                                    <td colspan="9">{$list->render()}</td>
                                </tr>
							</tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        
    </div>
    
</body>
{/block}
